#include <stdio.h>

int main(int argc, char *argv[]) 
{
	float base; int pos, ans, i;
	scanf("%f %d", &base, &pos);

	base = base - (int)base;

	for (i=0; i<pos; i++) {
		base = base * 2;
		ans = (int)base;
		base = base - ans;
	}

	printf("%d\n", ans);

	return 0;
}
